<%@ page import="java.security.Principal" %>
<%--
  Created by IntelliJ IDEA.
  User: alexz
  Date: 14-9-15
  Time: 下午2:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Login</title>
</head>
<body>
<%
    Principal userPrincipal = request.getUserPrincipal();
    if (userPrincipal != null) {
        String contextPath = request.getContextPath();
        response.sendRedirect(contextPath + "/results.html");
    }
%>
<form action="/j_security_check" method="post">
    <table>
        <tr>
            <td>Username:</td>
            <td>
                <input type="text" name="j_username"/>
            </td>
        </tr>
        <tr>
            <td>Password:</td>
            <td>
                <input type="password" name="j_password"/>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" value="SUBMIT"/>
            </td>
        </tr>
    </table>
</form>
</body>
</html>